<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

            <!--app-->
       <link rel="stylesheet" href="css/fonts/font-awesome.min.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/appcan.icon.css">
        <link rel="stylesheet" href="css/appcan.control.css">
        <link rel="stylesheet" href="css_sdk/css/main.css">
        <link rel="stylesheet" href="test_content/css/set.css">
           <!--amazeui-->
        <link rel="stylesheet" href="assets/css/amazeui.min.css">
        <link rel="stylesheet" href="assets/css/app.css">
        <script src="js/jquery-1.8.3.min.js"></script>
        <style>
        .c-org-b1 {
                background-color: #ff6e8f;
            }
        .c-org-b2 {
           background-color: #76d0b6;
        }
        .c-org-b3 {
           background-color: #face4b;
        }
        .c-org-b4 {
           background-color: #82afe8;
        }
        .am-navbar-default .am-navbar-nav {
            background-color: #ffffff;
        }
        .am-navbar-default a, .am-navbar-one a {
            color: #afb7b9;
        }
        .uh-acc1 {
            height: 15em;
        }
        .uwh-acc1 {
            width: 5em;
            height: 5em;
        }
        .uc-a1 {
            -webkit-border-radius: 0.3em;
            border-radius: 3em;
        }
        .box-r{
            padding-top: 1.6em;padding-bottom:1.6em;
        }
        .logout_div{
            position:absolute;
            width:1.5em;
            height:1.5em;
            right:1em;/*   定位到右上   */
            top:1em;
        }
        </style>
</head>

<body class="um-vp bc-bg" >
 <div class="ub ub-ver">
            <div class="ub-img1 accban uh-acc1 ub-fh ub ub-ver">
                <div class="uinn-a1 ub ub-ver ub-f1 ub-pc ub-ac">
                    <img  id="logout" class="logout_div" src="images/logout.png" alt="退出" onclick="u_logout()">
                    <img  id="logo"src="" style="min-height:5em">
                    <div style="margin-top:0.5em" class="bc-text-head umar-t" id="username">正在加载</div>
                    <div style="margin-top:0.5em" class="bc-text-head umar-t" id="role_name"></div>
                </div>
                <div class="ub c-bla-50 ubb ubt b-wh-acc1 uinn-acc1 ub-ae bc-text-head">
                    <div class="ub ub-ver ub-f1 ulev-4 ub-pc ubr b-gra-acc2 us-acc2 uinn-acc2" onclick="openwin('join.html')">
                        <div class="tx-c ub-f1 ub ub-ac ub-pc" style="margin-top:1em;">
                            <div style="margin-left:-0.5em;margin-right:0.3em"><img src="images/jiameng.png" style="height:1.5em"></div>
                            <div>推荐加盟店</div>
                        </div>
                          <div class="tx-c ub-f1 ub ub-ac ub-pc" id="num"></div>
                       
                    </div>
                    
                    
                     <div class="ub ub-ver ub-f1 ulev-4 ub-pc  b-gra-acc2 us-acc2 uinn-acc2" onclick="openwin('store.html')">
                        <div class="tx-c ub-f1 ub ub-ac ub-pc" style="margin-top:1em;margin-bottom: 1em">
                            <div style="margin-right:0.3em"><img src="images/kucun.png" style="height:1.5em"></div>
                            <div >查看库存&nbsp;&nbsp;</div>
                            
                        </div>
                    </div>
                    
                    
                     <div class="ub ub-ver ub-f1 ulev-4 ub-pc ubl b-gra-acc2 us-acc2 uinn-acc2">
                        <div class="tx-c ub-f1 ub ub-ac ub-pc" style="margin-top:1em;">
                            <div style="margin-right:0.3em"><img src="images/shouru.png" style="height:1.5em"></div>
                            <div>今日收入&nbsp;&nbsp;</div>
                           
                        </div>
                         <div class="tx-c ub-f1 ub ub-ac ub-pc" id="price"></div>
                    </div>
                    

                </div>
            </div>
            <div class="ub-f1 ub ub-ver">
                <div class="ub bc-text">
                    <div class="ub-f1 ub ub-ver ub-ac ub-pc box-r" style="border-right: 1px #E2E0E0 solid;" onclick="openwin('money.html')">
                        <div class="ub-img uwh-acc2 umar-at1" style="background-image: url(images/money.png);"></div>
                        <div class="ulev-1 umar-t-acc1">
                            我的资金
                        </div>
                    </div>
                    <div class="ub-f1 ub ub-ver ub-ac ub-pc box-r" style="border-right: 1px #E2E0E0 solid;" onclick="openwin('order.html')">
                        <div class="ub-img uwh-acc2 umar-at1" style="background-image: url(images/order.png);"></div>
                        <div class="ulev-1 umar-t-acc1">
                            我的订单
                        </div>
                    </div>
                   
                    <div class="ub-f1 ub ub-ver ub-ac ub-pc box-r" onclick="openwin('new_user.html')">
                        <div class="ub-img uwh-acc2 umar-at1" style="background-image: url(images/add.png);"></div>
                        <div class="ulev-1 umar-t-acc1">
                            会员录入
                        </div>
                    </div>
                    
                </div>
                <div class="ub bc-text">
                    <div class="ub-f1 ub ub-ver ub-ac ub-pc box-r" style="border-right: 1px #E2E0E0 solid;border-top: 1px #E2E0E0 solid;border-bottom:1px #E2E0E0 solid;" onclick="openwin('userlist.html')">
                        <div class="ub-img uwh-acc2 accIcon5 umar-at1" style="background-image: url(images/card.png);"></div>
                        <div class="ulev-1 umar-t-acc1">
                            会员信息
                        </div>
                    </div>
                    <div class="ub-f1 ub ub-ver ub-ac ub-pc box-r" style="border-right: 1px #E2E0E0 solid;border-top: 1px #E2E0E0 solid;border-bottom:1px #E2E0E0 solid;" onclick="openwin('password.html')">
                        <div class="ub-img uwh-acc2 accIcon6 umar-at1" style="background-image: url(images/pass.png);"></div>
                        <div class="ulev-1 umar-t-acc1">
                            密码修改
                        </div>
                    </div>
                    <div class="ub-f1 ub ub-ver ub-ac ub-pc box-r" style="border-top: 1px #E2E0E0 solid;border-bottom:1px #E2E0E0 solid;" onclick="getRetUid()">
                        <div class="ub-img uwh-acc2 accIcon7 umar-at1" style="background-image: url(images/set.png);"></div>
                        <div class="ulev-1 umar-t-acc1">
                            我的设置
                        </div>
                    </div>
                   
                </div>
            </div>
        </div>   

 <!-- Navbar -->
<div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default" id="">
      <ul class="am-navbar-nav am-cf am-avg-sm-4">
          <li >
            <a href="home.html" class="">
                <img src="images/home.png" alt="首页"/>
                <span class="am-navbar-label" >首页</span>
            </a>
          </li>
          <li >
            <a href="list.html" class="">
                <img src="images/pro.png" alt="微商城"/>
                <span class="am-navbar-label">微商城</span>
            </a>
          </li>
          <li >
            <a href="car.html" class="">
                <img src="images/car.png" alt="购物车"/>
                <span class="am-navbar-label">购物车</span>
            </a>
          </li>
          <li >
            <a href="set.html" class="">
                <img src="images/user-red.png" alt="个人中心"/>
                <span class="am-navbar-label" style="color: #eb4f38;">个人中心</span>
            </a>
          </li>
      </ul>
  </div>
     
 <script>
     $(document).ready(function(){
        click_sub();
     });
     function click_sub(){
            var uid=localStorage.getItem("username");
            var upwd=localStorage.getItem("password");
            if(uid==""){
                alert("您还没有登录");
                window.location.href="login.html";
                return;
            }
                $.ajax({
                    type: 'POST',
                    url: "http://101.200.158.44:80/CosmeticSunyuxiWebService/services/LoginWebService/LoginChk" ,
                    data: {"tUser":uid,"tPwd":upwd},
                    success: function(data){
                        //是否登陆成功
                        var f1 = data[0]["loginModelLise"][0]["f1"];
                        //用户ID
                        var f2 = data[0]["loginModelLise"][0]["f2"];
                        //角色
                        var f3 = data[0]["loginModelLise"][0]["f3"];
                        //用户名
                        var f4 = data[0]["loginModelLise"][0]["f4"];
                        //日利润
                        var f5 = data[0]["loginModelLise"][0]["f5"];
                        //等级名
                        var f6 = data[0]["loginModelLise"][0]["f6"];
                        //加盟店数量
                        var f7 = data[0]["loginModelLise"][0]["f7"];
                        //角色名称
                        var f8 = data[0]["loginModelLise"][0]["f8"];
                        
                        if (f1>0){
                            localStorage.setItem("user", f2);
                            localStorage.setItem("role", f3);
                            sessionStorage.setItem("username", f4);
                            sessionStorage.setItem("price", f5);
                            sessionStorage.setItem("num", f7);
                            sessionStorage.setItem("role_name", f8);
                            localStorage.setItem("username", uid);
                            localStorage.setItem("password", upwd);
                            
                            
                            if(localStorage.getItem("user")!=null){
                                document.getElementById("price").innerHTML=sessionStorage.getItem("price");
                                document.getElementById("num").innerHTML=sessionStorage.getItem("num");
                                document.getElementById("username").innerHTML=sessionStorage.getItem("username");
                                document.getElementById("role_name").innerHTML=sessionStorage.getItem("role_name");
                                if(localStorage["role"]!=null){

                                    if(localStorage["role"]=="3"){
                                        document.getElementById("logo").src="http://101.200.158.44/SyxView/UpImages/IDCard/accountimage/jinpaijiameng.png";
                                    }else{
                                        document.getElementById("logo").src="http://101.200.158.44/SyxView/UpImages/IDCard/accountimage/yinpaijiameng.png";
                                    }
                                }
                            }else{
                                 window.location.href="login.html";
                            }
                            
                        }else if(f1==-1){
                            alert("用户名不存在！");
                            window.location.href="login.html";
                        }else if(f1==-2){
                            alert("密码错误！");
                            window.location.href="login.html";
                        }
                    },
                    dataType: "json",
               }); 
               
               
        }
     function u_logout(){
           localStorage.setItem("user", "");
           localStorage.setItem("role", "");
           localStorage.setItem("username", "");
           localStorage.setItem("password", "");
           localStorage.setItem("price", "");
           localStorage.setItem("num", "");
           window.location.href="login.html";
     }
     
     function openwin(temp){
         window.location.href=temp;
     }
     
     function getRetUid(uid,uname){
 
            sessionStorage["user"]=localStorage.getItem("user");
            sessionStorage["role"]=localStorage.getItem("role");
            window.location.href="self_user.html";
    }
        
         
 </script>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
</body>
</html>
